import {
  createStore,
  applyMiddleware
} from '../redux'


// 获取合并后的 reducer
import combinedReducer from './reducers'

// 中间件
import logger from './redux-logger'
import thunk from './redux-thunk'
import promise from './redux-promise'



const store = applyMiddleware(promise, thunk, logger)(createStore)(combinedReducer)

/**
 * redux 中间件核心原理是 拦截改变 dispatch 方法
 * 
 * redux 中间件的格式是固定的
 *   接收一个对象
 */

export default store


